package cn.tedu.fengyuback.personal.controller;

import cn.tedu.fengyuback.base.response.JsonResult;
import cn.tedu.fengyuback.personal.pojo.dto.LikesQuery;
import cn.tedu.fengyuback.personal.pojo.vo.ArticlesVO;
import cn.tedu.fengyuback.personal.service.LikesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping(value = "/v1/personal/like")
public class LikesController {

    @Autowired
    LikesService likesService;

    @GetMapping("select")
    public JsonResult selectLike(LikesQuery likesQuery) {
        log.debug("查询点赞文章/回答的请求参数：{}",likesQuery);
        List<ArticlesVO> list = likesService.selectLike(likesQuery);
        return JsonResult.ok(list);
    }
}
